<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<div>
	<nav aria-label="Page navigation example">
		<ul class="pagination">
			<c:if test="${list.total==0}">
				<i>暂无数据</i>
			</c:if>
			<c:if test="${list.total!=0}">
				<li class="page-item">
					<a class="page-link" href="javascript:goPage(1)"aria-label="Previous">
						<span aria-hidden="true">首页</span>
					</a>
				</li>
				<li class="page-item">
					<a class="page-link" href="javascript:goPage(${list.prePage==0?1:list.prePage })"aria-label="Previous">
					<span aria-hidden="true">&laquo;</span>
					</a>
				</li>
			</c:if>
			<c:forEach items="${list.navigatepageNums}" var="n">
				<li class="page-item ${n==list.pageNum?"active":""}"><a
					class="page-link" href="javascript:goPage(${n})">${n}</a></li>
			</c:forEach>
			<c:if test="${list.total!=0}">
				<li class="page-item"><a class="page-link"
					href="javascript:goPage(${list.nextPage ==0?list.pages:list.nextPage})"
					aria-label="Next"> <span aria-hidden="true">&raquo;</span>
				</a></li>
				<li class="page-item"><a class="page-link"
					 href="javascript:goPage(${list.pages})"
					 aria-label="Next"> <span aria-hidden="true">尾页</span>
				</a></li>
			</c:if>
		</ul>
	</nav>

</div>
<script>
	function goPage(cur){
		$("form").append("<input type='hidden' name='cur' value='"+cur+"'>");
		// $("form").submit();
		$("#nav-tabContent").load("./list?cur="+cur+"&"+$("form").serialize());
	}
</script>
